Optimal. Leaf size=179 \[ \frac {\log (\cos (c+d x))}{a^2 d}+\frac {\left (a^2-b^2\right )^2 \left (5 a^2+b^2\right ) \log (a+b \sec (c+d x))}{a^2 b^6 d}-\frac {2 a \left (2 a^2-3 b^2\right ) \sec (c+d x)}{b^5 d}+\frac {3 \left (a^2-b^2\right ) \sec ^2(c+d x)}{2 b^4 d}-\frac {2 a \sec ^3(c+d x)}{3 b^3 d}+\frac {\sec ^4(c+d x)}{4 b^2 d}+\frac {\left (a^2-b^2\right )^3}{a b^6 d (a+b \sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.11, antiderivative size = 179, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {3970, 908}
\begin {gather*} \frac {\left (a^2-b^2\right )^3}{a b^6 d (a+b \sec (c+d x))}+\frac {\left (a^2-b^2\right )^2 \left (5 a^2+b^2\right ) \log (a+b \sec (c+d x))}{a^2 b^6 d}-\frac {2 a \left (2 a^2-3 b^2\right ) \sec (c+d x)}{b^5 d}+\frac {3 \left (a^2-b^2\right ) \sec ^2(c+d x)}{2 b^4 d}+\frac {\log (\cos (c+d x))}{a^2 d}-\frac {2 a \sec ^3(c+d x)}{3 b^3 d}+\frac {\sec ^4(c+d x)}{4 b^2 d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 908
Rule 3970
Rubi steps
\begin {align*} \int \frac {\tan ^7(c+d x)}{(a+b \sec (c+d x))^2} \, dx &=-\frac {\text {Subst}\left (\int \frac {\left (b^2-x^2\right )^3}{x (a+x)^2} \, dx,x,b \sec (c+d x)\right )}{b^6 d}\\ &=-\frac {\text {Subst}\left (\int \left (2 \left (2 a^3-3 a b^2\right )+\frac {b^6}{a^2 x}-3 \left (a^2-b^2\right ) x+2 a x^2-x^3+\frac {\left (a^2-b^2\right )^3}{a (a+x)^2}-\frac {\left (a^2-b^2\right )^2 \left (5 a^2+b^2\right )}{a^2 (a+x)}\right ) \, dx,x,b \sec (c+d x)\right )}{b^6 d}\\ &=\frac {\log (\cos (c+d x))}{a^2 d}+\frac {\left (a^2-b^2\right )^2 \left (5 a^2+b^2\right ) \log (a+b \sec (c+d x))}{a^2 b^6 d}-\frac {2 a \left (2 a^2-3 b^2\right ) \sec (c+d x)}{b^5 d}+\frac {3 \left (a^2-b^2\right ) \sec ^2(c+d x)}{2 b^4 d}-\frac {2 a \sec ^3(c+d x)}{3 b^3 d}+\frac {\sec ^4(c+d x)}{4 b^2 d}+\frac {\left (a^2-b^2\right )^3}{a b^6 d (a+b \sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(383\) vs. \(2(179)=358\).
time = 6.22, size = 383, normalized size = 2.14 \begin {gather*} \frac {(-a+b)^3 (a+b)^3 (b+a \cos (c+d x)) \sec ^2(c+d x)}{a^2 b^5 d (a+b \sec (c+d x))^2}+\frac {\left (-5 a^4+9 a^2 b^2-3 b^4\right ) (b+a \cos (c+d x))^2 \log (\cos (c+d x)) \sec ^2(c+d x)}{b^6 d (a+b \sec (c+d x))^2}+\frac {\left (5 a^6-9 a^4 b^2+3 a^2 b^4+b^6\right ) (b+a \cos (c+d x))^2 \log (b+a \cos (c+d x)) \sec ^2(c+d x)}{a^2 b^6 d (a+b \sec (c+d x))^2}+\frac {2 a \left (-2 a^2+3 b^2\right ) (b+a \cos (c+d x))^2 \sec ^3(c+d x)}{b^5 d (a+b \sec (c+d x))^2}-\frac {3 (-a+b) (a+b) (b+a \cos (c+d x))^2 \sec ^4(c+d x)}{2 b^4 d (a+b \sec (c+d x))^2}-\frac {2 a (b+a \cos (c+d x))^2 \sec ^5(c+d x)}{3 b^3 d (a+b \sec (c+d x))^2}+\frac {(b+a \cos (c+d x))^2 \sec ^6(c+d x)}{4 b^2 d (a+b \sec (c+d x))^2} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.15, size = 200, normalized size = 1.12
method | result | size |
derivativedivides | \(\frac {-\frac {a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}{a^{2} b^{5} \left (b +a \cos \left (d x +c \right )\right )}+\frac {\left (5 a^{6}-9 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) \ln \left (b +a \cos \left (d x +c \right )\right )}{b^{6} a^{2}}-\frac {-3 a^{2}+3 b^{2}}{2 b^{4} \cos \left (d x +c \right )^{2}}+\frac {\left (-5 a^{4}+9 b^{2} a^{2}-3 b^{4}\right ) \ln \left (\cos \left (d x +c \right )\right )}{b^{6}}+\frac {1}{4 b^{2} \cos \left (d x +c \right )^{4}}-\frac {2 a}{3 b^{3} \cos \left (d x +c \right )^{3}}-\frac {2 a \left (2 a^{2}-3 b^{2}\right )}{b^{5} \cos \left (d x +c \right )}}{d}\) | \(200\) |
default | \(\frac {-\frac {a^{6}-3 a^{4} b^{2}+3 a^{2} b^{4}-b^{6}}{a^{2} b^{5} \left (b +a \cos \left (d x +c \right )\right )}+\frac {\left (5 a^{6}-9 a^{4} b^{2}+3 a^{2} b^{4}+b^{6}\right ) \ln \left (b +a \cos \left (d x +c \right )\right )}{b^{6} a^{2}}-\frac {-3 a^{2}+3 b^{2}}{2 b^{4} \cos \left (d x +c \right )^{2}}+\frac {\left (-5 a^{4}+9 b^{2} a^{2}-3 b^{4}\right ) \ln \left (\cos \left (d x +c \right )\right )}{b^{6}}+\frac {1}{4 b^{2} \cos \left (d x +c \right )^{4}}-\frac {2 a}{3 b^{3} \cos \left (d x +c \right )^{3}}-\frac {2 a \left (2 a^{2}-3 b^{2}\right )}{b^{5} \cos \left (d x +c \right )}}{d}\) | \(200\) |
risch | \(-\frac {i x}{a^{2}}-\frac {2 i c}{a^{2} d}-\frac {2 \left (-71 a^{3} b^{3} {\mathrm e}^{4 i \left (d x +c \right )}-71 a^{3} b^{3} {\mathrm e}^{6 i \left (d x +c \right )}-182 a^{4} b^{2} {\mathrm e}^{5 i \left (d x +c \right )}+78 a^{2} b^{4} {\mathrm e}^{5 i \left (d x +c \right )}+45 a^{5} b \,{\mathrm e}^{4 i \left (d x +c \right )}-118 a^{4} b^{2} {\mathrm e}^{7 i \left (d x +c \right )}+15 a^{5} b \,{\mathrm e}^{2 i \left (d x +c \right )}+54 a^{2} b^{4} {\mathrm e}^{7 i \left (d x +c \right )}-27 a^{3} b^{3} {\mathrm e}^{8 i \left (d x +c \right )}-27 a^{3} b^{3} {\mathrm e}^{2 i \left (d x +c \right )}-118 a^{4} b^{2} {\mathrm e}^{3 i \left (d x +c \right )}-27 a^{4} b^{2} {\mathrm e}^{9 i \left (d x +c \right )}+9 a^{2} b^{4} {\mathrm e}^{9 i \left (d x +c \right )}+15 a^{5} b \,{\mathrm e}^{8 i \left (d x +c \right )}+54 a^{2} b^{4} {\mathrm e}^{3 i \left (d x +c \right )}+45 a^{5} b \,{\mathrm e}^{6 i \left (d x +c \right )}-27 a^{4} b^{2} {\mathrm e}^{i \left (d x +c \right )}+9 a^{2} b^{4} {\mathrm e}^{i \left (d x +c \right )}-18 b^{6} {\mathrm e}^{5 i \left (d x +c \right )}-3 b^{6} {\mathrm e}^{9 i \left (d x +c \right )}+90 a^{6} {\mathrm e}^{5 i \left (d x +c \right )}+60 a^{6} {\mathrm e}^{3 i \left (d x +c \right )}-12 b^{6} {\mathrm e}^{3 i \left (d x +c \right )}-12 b^{6} {\mathrm e}^{7 i \left (d x +c \right )}-3 b^{6} {\mathrm e}^{i \left (d x +c \right )}+60 a^{6} {\mathrm e}^{7 i \left (d x +c \right )}+15 a^{6} {\mathrm e}^{9 i \left (d x +c \right )}+15 a^{6} {\mathrm e}^{i \left (d x +c \right )}\right )}{3 d \,b^{5} \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )^{4} a^{2} \left (a \,{\mathrm e}^{2 i \left (d x +c \right )}+2 b \,{\mathrm e}^{i \left (d x +c \right )}+a \right )}-\frac {5 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{4}}{b^{6} d}+\frac {9 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right ) a^{2}}{b^{4} d}-\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}{b^{2} d}+\frac {5 a^{4} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{b^{6} d}-\frac {9 a^{2} \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{b^{4} d}+\frac {3 \ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{b^{2} d}+\frac {\ln \left ({\mathrm e}^{2 i \left (d x +c \right )}+\frac {2 b \,{\mathrm e}^{i \left (d x +c \right )}}{a}+1\right )}{a^{2} d}\) | \(720\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 227, normalized size = 1.27 \begin {gather*} -\frac {\frac {5 \, a^{3} b^{3} \cos \left (d x + c\right ) - 3 \, a^{2} b^{4} + 12 \, {\left (5 \, a^{6} - 9 \, a^{4} b^{2} + 3 \, a^{2} b^{4} - b^{6}\right )} \cos \left (d x + c\right )^{4} + 6 \, {\left (5 \, a^{5} b - 9 \, a^{3} b^{3}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (5 \, a^{4} b^{2} - 9 \, a^{2} b^{4}\right )} \cos \left (d x + c\right )^{2}}{a^{3} b^{5} \cos \left (d x + c\right )^{5} + a^{2} b^{6} \cos \left (d x + c\right )^{4}} + \frac {12 \, {\left (5 \, a^{4} - 9 \, a^{2} b^{2} + 3 \, b^{4}\right )} \log \left (\cos \left (d x + c\right )\right )}{b^{6}} - \frac {12 \, {\left (5 \, a^{6} - 9 \, a^{4} b^{2} + 3 \, a^{2} b^{4} + b^{6}\right )} \log \left (a \cos \left (d x + c\right ) + b\right )}{a^{2} b^{6}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 4.44, size = 312, normalized size = 1.74 \begin {gather*} -\frac {5 \, a^{3} b^{4} \cos \left (d x + c\right ) - 3 \, a^{2} b^{5} + 12 \, {\left (5 \, a^{6} b - 9 \, a^{4} b^{3} + 3 \, a^{2} b^{5} - b^{7}\right )} \cos \left (d x + c\right )^{4} + 6 \, {\left (5 \, a^{5} b^{2} - 9 \, a^{3} b^{4}\right )} \cos \left (d x + c\right )^{3} - 2 \, {\left (5 \, a^{4} b^{3} - 9 \, a^{2} b^{5}\right )} \cos \left (d x + c\right )^{2} - 12 \, {\left ({\left (5 \, a^{7} - 9 \, a^{5} b^{2} + 3 \, a^{3} b^{4} + a b^{6}\right )} \cos \left (d x + c\right )^{5} + {\left (5 \, a^{6} b - 9 \, a^{4} b^{3} + 3 \, a^{2} b^{5} + b^{7}\right )} \cos \left (d x + c\right )^{4}\right )} \log \left (a \cos \left (d x + c\right ) + b\right ) + 12 \, {\left ({\left (5 \, a^{7} - 9 \, a^{5} b^{2} + 3 \, a^{3} b^{4}\right )} \cos \left (d x + c\right )^{5} + {\left (5 \, a^{6} b - 9 \, a^{4} b^{3} + 3 \, a^{2} b^{5}\right )} \cos \left (d x + c\right )^{4}\right )} \log \left (-\cos \left (d x + c\right )\right )}{12 \, {\left (a^{3} b^{6} d \cos \left (d x + c\right )^{5} + a^{2} b^{7} d \cos \left (d x + c\right )^{4}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\tan ^{7}{\left (c + d x \right )}}{\left (a + b \sec {\left (c + d x \right )}\right )^{2}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 1023 vs.
\(2 (173) = 346\).
time = 3.64, size = 1023, normalized size = 5.72 \begin {gather*} \frac {\frac {12 \, {\left (5 \, a^{7} - 5 \, a^{6} b - 9 \, a^{5} b^{2} + 9 \, a^{4} b^{3} + 3 \, a^{3} b^{4} - 3 \, a^{2} b^{5} + a b^{6} - b^{7}\right )} \log \left ({\left | a + b + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} \right |}\right )}{a^{3} b^{6} - a^{2} b^{7}} - \frac {12 \, \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1 \right |}\right )}{a^{2}} - \frac {12 \, {\left (5 \, a^{4} - 9 \, a^{2} b^{2} + 3 \, b^{4}\right )} \log \left ({\left | -\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1 \right |}\right )}{b^{6}} - \frac {12 \, {\left (5 \, a^{7} + 7 \, a^{6} b - 7 \, a^{5} b^{2} - 13 \, a^{4} b^{3} - a^{3} b^{4} + 5 \, a^{2} b^{5} + 3 \, a b^{6} + b^{7} + \frac {5 \, a^{7} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {5 \, a^{6} b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {9 \, a^{5} b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {9 \, a^{4} b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {3 \, a^{3} b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {3 \, a^{2} b^{5} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {a b^{6} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {b^{7} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )}}{{\left (a + b + \frac {a {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1}\right )} a^{2} b^{6}} + \frac {125 \, a^{4} - 96 \, a^{3} b - 225 \, a^{2} b^{2} + 128 \, a b^{3} + 75 \, b^{4} + \frac {500 \, a^{4} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {288 \, a^{3} b {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} - \frac {972 \, a^{2} b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {416 \, a b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {348 \, b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}}{\cos \left (d x + c\right ) + 1} + \frac {750 \, a^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {288 \, a^{3} b {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} - \frac {1494 \, a^{2} b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {384 \, a b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {594 \, b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}} + \frac {500 \, a^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {96 \, a^{3} b {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} - \frac {972 \, a^{2} b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {96 \, a b^{3} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {348 \, b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{3}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{3}} + \frac {125 \, a^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} - \frac {225 \, a^{2} b^{2} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}} + \frac {75 \, b^{4} {\left (\cos \left (d x + c\right ) - 1\right )}^{4}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{4}}}{b^{6} {\left (\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} + 1\right )}^{4}}}{12 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 3.09, size = 505, normalized size = 2.82 \begin {gather*} \frac {\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6\,\left (20\,a^5+5\,a^4\,b-31\,a^3\,b^2-4\,a^2\,b^3+8\,a\,b^4+4\,b^5\right )}{a\,b^5}-\frac {2\,\left (15\,a^5+15\,a^4\,b-22\,a^3\,b^2-22\,a^2\,b^3+3\,a\,b^4+3\,b^5\right )}{3\,a\,b^5}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\,\left (60\,a^5+45\,a^4\,b-83\,a^3\,b^2-66\,a^2\,b^3+6\,a\,b^4+12\,b^5\right )}{3\,a\,b^5}-\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4\,\left (90\,a^5+45\,a^4\,b-127\,a^3\,b^2-56\,a^2\,b^3+6\,a\,b^4+18\,b^5\right )}{3\,a\,b^5}+\frac {2\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8\,\left (a-b\right )\,\left (-5\,a^4-5\,a^3\,b+4\,a^2\,b^2+4\,a\,b^3+b^4\right )}{a\,b^5}}{d\,\left (\left (b-a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^{10}+\left (5\,a-3\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^8+\left (2\,b-10\,a\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^6+\left (10\,a+2\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^4+\left (-5\,a-3\,b\right )\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+a+b\right )}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+1\right )}{a^2\,d}-\frac {\ln \left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )\,\left (5\,a^4-9\,a^2\,b^2+3\,b^4\right )}{b^6\,d}+\frac {\ln \left (a+b-a\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2+b\,{\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2\right )\,{\left (a^2-b^2\right )}^2\,\left (5\,a^2+b^2\right )}{a^2\,b^6\,d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________